package com.rytx.quartz.task;

import com.rytx.system.service.IArtOrderAfterService;
import com.rytx.system.service.IArtOrderService;
import com.rytx.system.service.IArtRentalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("artTask")
public class ArtTask {
    @Autowired
    private IArtOrderService artOrderService;

    @Autowired
    private IArtRentalService artRentalService;
    @Autowired
    private IArtOrderAfterService artOrderAfterService;//售后表

    public void firstPaymentTask() {
        System.out.println("执行首期扣款任务");
        artOrderService.firstPaymentTask();
    }

    public void zmnRefundTask() {
        System.out.println("执行退款任务");
        artOrderService.zmnRefundTask();
    }

    public void autoLeaseRenewalTask() {
        System.out.println("执行自动续租任务");
        artOrderService.autoLeaseRenewalTask();
    }

    public void autoConfirmReceiptTask() {
        System.out.println("执行自动收货任务");
        artOrderService.autoConfirmReceiptTask();
    }

    public void addFavoriteTask() {
        System.out.println("执行添加收藏任务");
        artRentalService.addFavoriteTask();
    }

    public void addViewHistoryTask() {
        System.out.println("执行添加浏览历史任务");
        artRentalService.addViewHistoryTask();
    }

    //售后解冻失败处理
    public void afterUnfreezeFailTask() {
        System.out.println("执行售后解冻失败处理任务");
        artOrderAfterService.afterUnfreezeFailTask();
    }

    public void unfreezeRecoveryOrderTask() {
        System.out.println("执行追缴成功解冻订单任务");
        artOrderService.unfreezeRecoveryOrderTask();
    }

    public void sendSmsTask() {
        System.out.println("执行租赁到期短信通知任务");
        artOrderService.sendSmsTask();
    }

    /**
     * 每个月10号执行
     * 废弃
     */
    public void serviceChargeTask() {
        System.out.println("已过7天无理由但未满1个月退还，租金还未扣除的情况下，需缴纳服务费（按首期计算）");
        artOrderService.serviceChargeTask();
    }

    /**
     * 每个月10号执行
     */
    public void autoNotReturnedTask() {
        System.out.println("客户不如期退还，自动按照每月续约扣费");
        artOrderService.autoNotReturnedTask();
    }
}
